<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .main {
            background-color: rgba(255, 255, 255, .3);
            width: 500px;
            height: 150px;
            border: 2px solid pink;
            position: relative;
        }

        .btn {
            position: absolute;
            top: 22px;
            left: 76px;
            border: 1px solid red;
        }
    </style>
</head>

<body>
    <div class="main">
        <h3>开心一笑</h3>
        <button class='btn'>换一个</button>
        <div class="content"></div>
    </div>
    <script src='./jquery-1.12.4.js'></script>
    <script>
        $(function () {
            function getJoke() {
                $('.content').html('加载中...')
                $.ajax({
                    type: 'get',
                    url: 'https://autumnfish.cn/api/joke',
                    success: function (backData) {
                        $('.content').html(backData);

                    }
                })
            }
            getJoke()
            $('.btn').on('click',function(){
                getJoke()
            })
        })
    </script>
</body>

</html>